<template>
  <div class="father">
    <h3>父组件</h3>
    <h4>{{ username }}</h4>
    <h4>{{ password }}</h4>
    <!-- v-model用在html标签上 -->
    <!-- <input type="text" v-model="username" /> -->
    <!-- 底层原理 -->
    <!-- <input type="text" :value="username" @input="username = (<HTMLInputElement>$event.target).value"> -->

    <!-- v-model用在组件标签上 -->
    <!-- <xiaojiInput v-model="username" /> -->
    <!-- <xiaojiInput
      :modelValue="username"
      @update:modelValue="username = $event" 触发事件时，所传递的数据
    /> -->

    <!-- 修改modelValue -->
    <xiaojiInput v-model:qwe="username" v-model:asd="password" />
  </div>
</template>

<script setup lang="ts" name="Father">
import { ref } from "vue";
import xiaojiInput from "./xiaojiInput.vue";
let username = ref("zhangsan");
let password = ref("xiaoji123");
</script>

<style scoped>
.father {
  padding: 20px;
  background-color: rgb(165, 164, 164);
  border-radius: 10px;
}
</style>
